<?php
/**
 * XmuSlh, web platform of Student Association Federation of Xiamen University
 * 
 * Rewritting one or some pages of StatusNet. 
 * To get the original version, please visit <http://status.net/>.
 * 
 * StatusNet, the distributed open-source microblogging tool
 * 
 * LICENCE: This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

/**
 * A Test! Action!.
 * To check something like path, router informatin and post...
 * 
 * 测试提交的数据, 路径信息和路由的信息, 用于开发使用!
 * 
 * @author		ytukie <ytukie@gmail.com>
 * @version		0.1
 */

// XmuSlh only.
if ( !defined('XMUSLH')) { exit(1); }

require_once INSTALLDIR . '/lib/slh_action.php';

class GetinfoAction extends Action
{
	function title()
	{
		return "Get info action!";
	}
	
	function isReadOnly($args)
	{
		return true;
	}
	
	function prepare($args)
	{
// echo "GetinfoAction prepare()!";
		parent::prepare($args);
		
		return true;
	}
	
	function handle($args)
	{
		parent::handle($args);
		
		$this->showPage();
	}
	
	/**
	 * Overriding.
	 * Show Body! The templated design pattern.
	 */
	function showBody()
	{
// TODO: Something like user! how to show?
		$this->elementStart('body');
		
		$this->elementStart('div');
		$this->showHeader();
		$this->showCore();
		
		echo '<h3>The action arguments:</h3>';
		var_dump($this->args);
		
		echo '<h3>The Request arguments:</h3>';
		var_dump($_REQUEST);
		
		echo '<h3>The Post arguments:</h3>';
		var_dump($_POST);
		
		echo '<h3>The Get arguments:</h3>';
		var_dump($_GET);
		
		echo '<h3>The Server arguments:</h3>';
		var_dump($_SERVER);

$this->raw('<br />');
$this->input('input_test', 'Input haha: ');
$this->submit('submit',	'button');

		$this->showFooter();
		$this->elementEnd('div');
		$this->showScripts();
		
		$this->elementEnd('body');
	}
}